/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.jrill;

import java.io.IOException;
import java.util.Properties;

/**
 *
 * @author Kazuto Waga<kzwaga at gmail.com>
 */
public class ContextUtils {
    /**
     * Returns spring properties for test.
     * @return 
     */
    public static Properties getSpringProperties() {
        try {
            Properties properties = new Properties();
            properties.load(ClassLoader.getSystemResourceAsStream("spring.properties"));
            return properties;
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
    
    /**
     * Returns Springframework major version.
     * @return 
     */
    public static Object getSpringVersion() {
        Properties p = getSpringProperties();
        return p.get("spring.version");
    }
}
